package com.qf.controller;

import com.qf.common.http.Result;

import com.qf.entiy.po.LoginAdmin;
import com.qf.entiy.vo.JqueryTreeView;
import com.qf.service.impl.AdminModuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

@Controller
public class IndexController {


    @RequestMapping("index")
    public String toIndex() {
        return "index";
    }

    @RequestMapping("func-list")
    @ResponseBody
    public Result<List<JqueryTreeView>> getModuleList(LoginAdmin loginAdmin) {
        List<JqueryTreeView> result = new ArrayList<>(2);

        JqueryTreeView goods = new JqueryTreeView();
        goods.setFid(1);
        goods.setText("商品管理");
        goods.setHref("goods/list");
        result.add(goods);

        JqueryTreeView orders = new JqueryTreeView();
        orders.setFid(2);
        orders.setText("订单管理");
        orders.setHref("order/list");
        result.add(orders);

        return Result.success(result);
    }
}